package com.rattsoftware.server.service;

import java.util.List;

import com.rattsoftware.server.admin.model.Staff;
import com.rattsoftware.server.admin.model.exceptions.RattsSecurityException;
import com.rattsoftware.server.admin.model.paging.PagingLoadConfig;
import com.rattsoftware.server.admin.model.paging.PagingLoadResult;

public interface StaffService {
	/**
     * Gets a staff based on its names
     * @param firstName String First Name
     * @param lastName String Last Name
     * @return Staff, or null if no match found
     * @throws RattsSecurityException For any <tt>security related</tt> that occurs on the <tt>service layer.</tt>
     */
	Staff getStaff(String firstName, String lastName) throws RattsSecurityException;  
	
	/**
	 * Fetches all the system <tt>Staff.</tt>
	 * 
	 * @return <tt>List</tt> of <tt>Staff.</tt>
	 * @throws RattsSecurityException For any <tt>security related</tt> that occurs on the <tt>service layer.</tt>
	 */
	List<Staff> getStaffList() throws RattsSecurityException;
	
	/**
	 * Saves a dirty or new <tt>Staff</tt>.
	 * 
	 * @param staff <tt>Staff</tt> to save.
	 * @throws RattsSecurityException For any <tt>security related</tt> that occurs on the <tt>service layer.</tt>
	 */
	void saveStaff(Staff staff) throws RattsSecurityException;
	
	/**
	 * Deletes a given <tt>Staff</tt>.
	 * 
	 * @param staff <tt>Staff</tt> to delete.
	 * @throws RattsSecurityException For any <tt>security related</tt> that occurs on the <tt>service layer.</tt>
	 */
	void deleteStaff(Staff staff) throws RattsSecurityException;
	
	/**
	 * Persists a given list of staff to the database.
	 * 
	 * @param staff List of staff to persist.
	 */
	void saveStaff(List<Staff> staff) throws RattsSecurityException;
	
	/**
	 * Retrieves a page of the Staff data.
	 * 
	 * @param pagingLoadConfig
	 *            config to specify paging related config
	 * @return PagingLoadResult containing a page of Staff data
	 */
	PagingLoadResult<Staff> getStaffList(PagingLoadConfig pagingLoadConfig) throws RattsSecurityException;
	
	/**
	 * Retrieves a page of the Staff data belonging to a given department.
	 *
	 * @param deptId
	 *            Department Id
	 * @param pagingLoadConfig
	 *            config to specify paging related config
	 * @return PagingLoadResult containing a page of Staff data
	 */
	PagingLoadResult<Staff> getStaffList( Integer deptId, PagingLoadConfig pagingLoadConfig) throws RattsSecurityException;
}